fix(dflash): auto-detect GPU arch to prevent sm_120a on consumer Blackwell#48
Open
easel wants to merge 1 commit intoLuce-Org:mainfrom
Open
fix(dflash): auto-detect GPU arch to prevent sm_120a on consumer Blackwell#48easel wants to merge 1 commit intoLuce-Org:mainfrom
easel wants to merge 1 commit intoLuce-Org:mainfrom
Conversation
3 tasks
2f759e7 to
653df28
Compare
This was referenced Apr 27, 2026
Contributor
|
@easel thanks for the contribution! Is the speed problem still present ? |
Contributor
Author
Yes. I think it's related to the workflow -- I'm putting together a small benchmark script to compare. |
ffdc796 to
e6dc0cd
Compare
e6dc0cd to
858b84b
Compare
Contributor
Author
|
This may not be necessary if expectation is to always build multi-arch binary. I ran into it because claude got excited about optimizing and ended up with a slightly incompatible build. |
javierpazo
added a commit
to javierpazo/lucebox-hub
that referenced
this pull request
May 9, 2026
Two CMake-side rough edges that bit me on Windows MSVC + CUDA 12.x
on RTX 6000 Ada (sm_89, Ada-only):
1. CUDA architectures: when no explicit override is provided,
the previous CMakeLists could fall back to `75;86`, which
caused silent build issues on Ada-only setups. This change
respects DFLASH27B_USER_CUDA_ARCHITECTURES (e.g. `89`) and
uses it consistently across the dflash and submodule
ggml/llama.cpp consumers.
2. BSA was sometimes silently disabled depending on detection
order. DFLASH27B_ENABLE_BSA is now respected as an explicit
opt-in/opt-out and a clear status line is printed at
configure time.
Net effect: a single-arch Ada-only build with BSA enabled is
reproducible from a clean checkout. Default behaviour (no
DFLASH27B_USER_CUDA_ARCHITECTURES set, BSA on) is preserved for
existing users.
Validation:
cmake -S dflash -B dflash/build/Release \
-DCMAKE_BUILD_TYPE=Release \
-DDFLASH27B_USER_CUDA_ARCHITECTURES=89 \
-DDFLASH27B_ENABLE_BSA=ON
cmake --build dflash/build/Release --target test_dflash --parallel 8
-> BUILD_EXIT_CODE=0, sm_89 single-arch confirmed.
Verification vs existing community PRs:
COMP-COMPL with Luce-Org#48 ("auto-detect GPU arch to prevent sm_120a on
consumer Blackwell", open) and Luce-Org#91 ("expose BSA config as CLI
flags with safety warnings", merged 2026-05-04). Luce-Org#48 covers
auto-detect; Luce-Org#91 covers runtime CLI. This PR covers the
build-time CMake side: respect the user's explicit
DFLASH27B_USER_CUDA_ARCHITECTURES override and keep
DFLASH27B_ENABLE_BSA honest. The three PRs together give
sensible defaults per hardware tier.
Author: Javier Pazo <xabicasa@gmail.com>
javierpazo
added a commit
to javierpazo/lucebox-hub
that referenced
this pull request
May 10, 2026
Two CMake-side rough edges that bit me on Windows MSVC + CUDA 12.x
on RTX 6000 Ada (sm_89, Ada-only):
1. CUDA architectures: when no explicit override is provided,
the previous CMakeLists could fall back to `75;86`, which
caused silent build issues on Ada-only setups. This change
respects DFLASH27B_USER_CUDA_ARCHITECTURES (e.g. `89`) and
uses it consistently across the dflash and submodule
ggml/llama.cpp consumers.
2. BSA was sometimes silently disabled depending on detection
order. DFLASH27B_ENABLE_BSA is now respected as an explicit
opt-in/opt-out and a clear status line is printed at
configure time.
Net effect: a single-arch Ada-only build with BSA enabled is
reproducible from a clean checkout. Default behaviour (no
DFLASH27B_USER_CUDA_ARCHITECTURES set, BSA on) is preserved for
existing users.
Validation:
cmake -S dflash -B dflash/build/Release \
-DCMAKE_BUILD_TYPE=Release \
-DDFLASH27B_USER_CUDA_ARCHITECTURES=89 \
-DDFLASH27B_ENABLE_BSA=ON
cmake --build dflash/build/Release --target test_dflash --parallel 8
-> BUILD_EXIT_CODE=0, sm_89 single-arch confirmed.
Verification vs existing community PRs:
COMP-COMPL with Luce-Org#48 ("auto-detect GPU arch to prevent sm_120a on
consumer Blackwell", open) and Luce-Org#91 ("expose BSA config as CLI
flags with safety warnings", merged 2026-05-04). Luce-Org#48 covers
auto-detect; Luce-Org#91 covers runtime CLI. This PR covers the
build-time CMake side: respect the user's explicit
DFLASH27B_USER_CUDA_ARCHITECTURES override and keep
DFLASH27B_ENABLE_BSA honest. The three PRs together give
sensible defaults per hardware tier.
Author: Javier Pazo <xabicasa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On CUDA 13.2+ with consumer Blackwell GPUs (for example, RTX 5090, SM 12.0), using an unset
CMAKE_CUDA_ARCHITECTURESornativecan resolve tosm_120ainstead ofsm_120, which can triggerCUDA_ERROR_ILLEGAL_INSTRUCTIONat runtime onconsumer hardware.
Fix (auto-detect only)
CMAKE_CUDA_ARCHITECTURESis unset ornative, runnvidia-smi --query-gpu=compute_cap --format=csv,noheader.12.0) and setCMAKE_CUDA_ARCHITECTURESexplicitly (for example120).dflash/CMakeLists.txtso it can be reviewed andmerged independently from consumer-specific workaround behavior.
Test plan
cmake -B build -S dflash/printsdflash27b: GPU compute_cap 12.0 → CUDA_ARCHITECTURES=120on Blackwell hardware.cmake --build buildsucceeds without CUDA-arch related compiler/runtime errors on a Blackwell consumer system.